﻿using Abp.Owin;
using FutureApp.Api.Controllers;
using FutureApp.Web;
using Microsoft.AspNet.Identity;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.Facebook;
using Microsoft.Owin.Security.QQ;
using Microsoft.Owin.Security.SinaWeibo;
using Microsoft.Owin.Security.WeChat;
using Owin;

[assembly: OwinStartup(typeof(Startup))]

namespace FutureApp.Web
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.UseAbp();

            app.UseOAuthBearerAuthentication(AccountController.OAuthBearerOptions);

            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath = new PathString("/Account/Login")
            });

            app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);

            app.UseQQConnectAuthentication(new QQConnectAuthenticationOptions
            {
                AuthenticationType = "QQ",
                AppId = "111",
                AppSecret = "111"
            });

            app.UseSinaWeiboAuthentication(new SinaWeiboAccountAuthenticationOptions
            {
                AuthenticationType = "weibo",
                AppId = "111",
                AppSecret = "111"
            });

            app.UseWeChatAuthentication(new WeChatAuthenticationOptions
            {
                AuthenticationType = "wechat",
                AppId = "111",
                AppSecret = "111"
            });

            app.UseFacebookAuthentication(new FacebookAuthenticationOptions
            {
                AuthenticationType = "facebook",
                AppId = "111",
                AppSecret = "111"
            });
        }
    }
}